3.1.87 \(\int \frac {(d+e x)^2 (a+b \log (c x^n))^2}{x} \, dx\) [87]

Optimal. Leaf size=137 \[ -4 a b d e n x+4 b^2 d e n^2 x+\frac {1}{4} b^2 e^2 n^2 x^2-4 b^2 d e n x \log \left (c x^n\right )-\frac {1}{2} b e^2 n x^2 \left (a+b \log \left (c x^n\right )\right )+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n} \]

[Out]

-4*a*b*d*e*n*x+4*b^2*d*e*n^2*x+1/4*b^2*e^2*n^2*x^2-4*b^2*d*e*n*x*ln(c*x^n)-1/2*b*e^2*n*x^2*(a+b*ln(c*x^n))+2*d
*e*x*(a+b*ln(c*x^n))^2+1/2*e^2*x^2*(a+b*ln(c*x^n))^2+1/3*d^2*(a+b*ln(c*x^n))^3/b/n

________________________________________________________________________________________

Rubi [A]
time = 0.16, antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 8, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {2388, 2339, 30, 2333, 2332, 2367, 2342, 2341} \begin {gather*} \frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{2} b e^2 n x^2 \left (a+b \log \left (c x^n\right )\right )-4 a b d e n x-4 b^2 d e n x \log \left (c x^n\right )+4 b^2 d e n^2 x+\frac {1}{4} b^2 e^2 n^2 x^2 \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((d + e*x)^2*(a + b*Log[c*x^n])^2)/x,x]

[Out]

-4*a*b*d*e*n*x + 4*b^2*d*e*n^2*x + (b^2*e^2*n^2*x^2)/4 - 4*b^2*d*e*n*x*Log[c*x^n] - (b*e^2*n*x^2*(a + b*Log[c*
x^n]))/2 + 2*d*e*x*(a + b*Log[c*x^n])^2 + (e^2*x^2*(a + b*Log[c*x^n])^2)/2 + (d^2*(a + b*Log[c*x^n])^3)/(3*b*n
)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2339

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, x]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2367

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = Expand
Integrand[(a + b*Log[c*x^n])^p, (d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n, p, q, r}
, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[r]))

Rule 2388

Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_))^(q_.))/(x_), x_Symbol] :> Dist[d, Int[(d
+ e*x)^(q - 1)*((a + b*Log[c*x^n])^p/x), x], x] + Dist[e, Int[(d + e*x)^(q - 1)*(a + b*Log[c*x^n])^p, x], x] /
; FreeQ[{a, b, c, d, e, n}, x] && IGtQ[p, 0] && GtQ[q, 0] && IntegerQ[2*q]

Rubi steps

\begin {align*} \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx &=d \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx+e \int (d+e x) \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=d^2 \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx+e \int \left (d \left (a+b \log \left (c x^n\right )\right )^2+e x \left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx+(d e) \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=d e x \left (a+b \log \left (c x^n\right )\right )^2+(d e) \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx+e^2 \int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx+\frac {d^2 \text {Subst}\left (\int x^2 \, dx,x,a+b \log \left (c x^n\right )\right )}{b n}-(2 b d e n) \int \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=-2 a b d e n x+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-(2 b d e n) \int \left (a+b \log \left (c x^n\right )\right ) \, dx-\left (2 b^2 d e n\right ) \int \log \left (c x^n\right ) \, dx-\left (b e^2 n\right ) \int x \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=-4 a b d e n x+2 b^2 d e n^2 x+\frac {1}{4} b^2 e^2 n^2 x^2-2 b^2 d e n x \log \left (c x^n\right )-\frac {1}{2} b e^2 n x^2 \left (a+b \log \left (c x^n\right )\right )+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\left (2 b^2 d e n\right ) \int \log \left (c x^n\right ) \, dx\\ &=-4 a b d e n x+4 b^2 d e n^2 x+\frac {1}{4} b^2 e^2 n^2 x^2-4 b^2 d e n x \log \left (c x^n\right )-\frac {1}{2} b e^2 n x^2 \left (a+b \log \left (c x^n\right )\right )+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 114, normalized size = 0.83 \begin {gather*} \frac {1}{4} b e^2 n x^2 \left (-2 a+b n-2 b \log \left (c x^n\right )\right )+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-4 b d e n x \left (a-b n+b \log \left (c x^n\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)^2*(a + b*Log[c*x^n])^2)/x,x]

[Out]

(b*e^2*n*x^2*(-2*a + b*n - 2*b*Log[c*x^n]))/4 + 2*d*e*x*(a + b*Log[c*x^n])^2 + (e^2*x^2*(a + b*Log[c*x^n])^2)/
2 + (d^2*(a + b*Log[c*x^n])^3)/(3*b*n) - 4*b*d*e*n*x*(a - b*n + b*Log[c*x^n])

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.32, size = 2543, normalized size = 18.56

method result size
risch \(\text {Expression too large to display}\) \(2543\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)^2*(a+b*ln(c*x^n))^2/x,x,method=_RETURNVERBOSE)

[Out]

1/2*a^2*e^2*x^2-1/2*I*ln(x)^2*Pi*b^2*d^2*n*csgn(I*x^n)*csgn(I*c*x^n)^2-1/2*Pi^2*b^2*d*e*x*csgn(I*c)^2*csgn(I*x
^n)^2*csgn(I*c*x^n)^2+Pi^2*b^2*d*e*x*csgn(I*c)^2*csgn(I*x^n)*csgn(I*c*x^n)^3+Pi^2*b^2*d*e*x*csgn(I*c)*csgn(I*x
^n)^2*csgn(I*c*x^n)^3+2*a^2*d*e*x+a^2*d^2*ln(x)+1/2*I*Pi*a*b*e^2*x^2*csgn(I*x^n)*csgn(I*c*x^n)^2+I*ln(x)*Pi*a*
b*d^2*csgn(I*x^n)*csgn(I*c*x^n)^2+(1/2*b^2*e^2*x^2+2*b^2*d*e*x+b^2*d^2*ln(x))*ln(x^n)^2+(-b^2*d^2*n*ln(x)^2-2*
I*Pi*b^2*d*e*x*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)-I*ln(x)*Pi*b^2*d^2*csgn(I*c*x^n)^3-1/2*I*Pi*b^2*e^2*x^2*csg
n(I*c*x^n)^3+2*I*Pi*b^2*d*e*x*csgn(I*c)*csgn(I*c*x^n)^2-I*ln(x)*Pi*b^2*d^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)
+I*ln(x)*Pi*b^2*d^2*csgn(I*c)*csgn(I*c*x^n)^2+2*I*Pi*b^2*d*e*x*csgn(I*x^n)*csgn(I*c*x^n)^2-2*I*Pi*b^2*d*e*x*cs
gn(I*c*x^n)^3+ln(c)*b^2*e^2*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*c*x^n)^3+1/2*ln(x)*Pi^2*b^2*d^2*csgn(I*c)*csgn(I*x^n)^2*c
sgn(I*c*x^n)^3-ln(x)*Pi^2*b^2*d^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)^4-1/2*Pi^2*b^2*e^2*x^2*csgn(I*c)*csgn(I*
x^n)*csgn(I*c*x^n)^4-2*I*ln(c)*Pi*b^2*d*e*x*csgn(I*c*x^n)^3+1/2*I*Pi*a*b*e^2*x^2*csgn(I*c)*csgn(I*c*x^n)^2+1/2
*I*ln(c)*Pi*b^2*e^2*x^2*csgn(I*x^n)*csgn(I*c*x^n)^2-4*n*ln(c)*b^2*d*e*x+4*ln(c)*a*b*d*e*x

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 198, normalized size = 1.45 \begin {gather*} \frac {1}{2} \, b^{2} x^{2} e^{2} \log \left (c x^{n}\right )^{2} + 2 \, b^{2} d x e \log \left (c x^{n}\right )^{2} - \frac {1}{2} \, a b n x^{2} e^{2} - 4 \, a b d n x e + a b x^{2} e^{2} \log \left (c x^{n}\right ) + 4 \, a b d x e \log \left (c x^{n}\right ) + \frac {b^{2} d^{2} \log \left (c x^{n}\right )^{3}}{3 \, n} + \frac {1}{2} \, a^{2} x^{2} e^{2} + 4 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} d e + 2 \, a^{2} d x e + \frac {a b d^{2} \log \left (c x^{n}\right )^{2}}{n} + a^{2} d^{2} \log \left (x\right ) + \frac {1}{4} \, {\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} b^{2} e^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(a+b*log(c*x^n))^2/x,x, algorithm="maxima")

[Out]

1/2*b^2*x^2*e^2*log(c*x^n)^2 + 2*b^2*d*x*e*log(c*x^n)^2 - 1/2*a*b*n*x^2*e^2 - 4*a*b*d*n*x*e + a*b*x^2*e^2*log(
c*x^n) + 4*a*b*d*x*e*log(c*x^n) + 1/3*b^2*d^2*log(c*x^n)^3/n + 1/2*a^2*x^2*e^2 + 4*(n^2*x - n*x*log(c*x^n))*b^
2*d*e + 2*a^2*d*x*e + a*b*d^2*log(c*x^n)^2/n + a^2*d^2*log(x) + 1/4*(n^2*x^2 - 2*n*x^2*log(c*x^n))*b^2*e^2

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 277 vs. \(2 (130) = 260\).
time = 0.46, size = 277, normalized size = 2.02 \begin {gather*} \frac {1}{3} \, b^{2} d^{2} n^{2} \log \left (x\right )^{3} + \frac {1}{4} \, {\left (b^{2} n^{2} - 2 \, a b n + 2 \, a^{2}\right )} x^{2} e^{2} + 2 \, {\left (2 \, b^{2} d n^{2} - 2 \, a b d n + a^{2} d\right )} x e + \frac {1}{2} \, {\left (b^{2} x^{2} e^{2} + 4 \, b^{2} d x e\right )} \log \left (c\right )^{2} + \frac {1}{2} \, {\left (b^{2} n^{2} x^{2} e^{2} + 4 \, b^{2} d n^{2} x e + 2 \, b^{2} d^{2} n \log \left (c\right ) + 2 \, a b d^{2} n\right )} \log \left (x\right )^{2} - \frac {1}{2} \, {\left ({\left (b^{2} n - 2 \, a b\right )} x^{2} e^{2} + 8 \, {\left (b^{2} d n - a b d\right )} x e\right )} \log \left (c\right ) + \frac {1}{2} \, {\left (2 \, b^{2} d^{2} \log \left (c\right )^{2} + 2 \, a^{2} d^{2} - {\left (b^{2} n^{2} - 2 \, a b n\right )} x^{2} e^{2} - 8 \, {\left (b^{2} d n^{2} - a b d n\right )} x e + 2 \, {\left (b^{2} n x^{2} e^{2} + 4 \, b^{2} d n x e + 2 \, a b d^{2}\right )} \log \left (c\right )\right )} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(a+b*log(c*x^n))^2/x,x, algorithm="fricas")

[Out]

1/3*b^2*d^2*n^2*log(x)^3 + 1/4*(b^2*n^2 - 2*a*b*n + 2*a^2)*x^2*e^2 + 2*(2*b^2*d*n^2 - 2*a*b*d*n + a^2*d)*x*e +
 1/2*(b^2*x^2*e^2 + 4*b^2*d*x*e)*log(c)^2 + 1/2*(b^2*n^2*x^2*e^2 + 4*b^2*d*n^2*x*e + 2*b^2*d^2*n*log(c) + 2*a*
b*d^2*n)*log(x)^2 - 1/2*((b^2*n - 2*a*b)*x^2*e^2 + 8*(b^2*d*n - a*b*d)*x*e)*log(c) + 1/2*(2*b^2*d^2*log(c)^2 +
 2*a^2*d^2 - (b^2*n^2 - 2*a*b*n)*x^2*e^2 - 8*(b^2*d*n^2 - a*b*d*n)*x*e + 2*(b^2*n*x^2*e^2 + 4*b^2*d*n*x*e + 2*
a*b*d^2)*log(c))*log(x)

________________________________________________________________________________________

Sympy [A]
time = 0.48, size = 269, normalized size = 1.96 \begin {gather*} \begin {cases} \frac {a^{2} d^{2} \log {\left (c x^{n} \right )}}{n} + 2 a^{2} d e x + \frac {a^{2} e^{2} x^{2}}{2} + \frac {a b d^{2} \log {\left (c x^{n} \right )}^{2}}{n} - 4 a b d e n x + 4 a b d e x \log {\left (c x^{n} \right )} - \frac {a b e^{2} n x^{2}}{2} + a b e^{2} x^{2} \log {\left (c x^{n} \right )} + \frac {b^{2} d^{2} \log {\left (c x^{n} \right )}^{3}}{3 n} + 4 b^{2} d e n^{2} x - 4 b^{2} d e n x \log {\left (c x^{n} \right )} + 2 b^{2} d e x \log {\left (c x^{n} \right )}^{2} + \frac {b^{2} e^{2} n^{2} x^{2}}{4} - \frac {b^{2} e^{2} n x^{2} \log {\left (c x^{n} \right )}}{2} + \frac {b^{2} e^{2} x^{2} \log {\left (c x^{n} \right )}^{2}}{2} & \text {for}\: n \neq 0 \\\left (a + b \log {\left (c \right )}\right )^{2} \left (d^{2} \log {\left (x \right )} + 2 d e x + \frac {e^{2} x^{2}}{2}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)**2*(a+b*ln(c*x**n))**2/x,x)

[Out]

Piecewise((a**2*d**2*log(c*x**n)/n + 2*a**2*d*e*x + a**2*e**2*x**2/2 + a*b*d**2*log(c*x**n)**2/n - 4*a*b*d*e*n
*x + 4*a*b*d*e*x*log(c*x**n) - a*b*e**2*n*x**2/2 + a*b*e**2*x**2*log(c*x**n) + b**2*d**2*log(c*x**n)**3/(3*n)
+ 4*b**2*d*e*n**2*x - 4*b**2*d*e*n*x*log(c*x**n) + 2*b**2*d*e*x*log(c*x**n)**2 + b**2*e**2*n**2*x**2/4 - b**2*
e**2*n*x**2*log(c*x**n)/2 + b**2*e**2*x**2*log(c*x**n)**2/2, Ne(n, 0)), ((a + b*log(c))**2*(d**2*log(x) + 2*d*
e*x + e**2*x**2/2), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 321 vs. \(2 (130) = 260\).
time = 2.24, size = 321, normalized size = 2.34 \begin {gather*} \frac {1}{2} \, b^{2} n^{2} x^{2} e^{2} \log \left (x\right )^{2} + 2 \, b^{2} d n^{2} x e \log \left (x\right )^{2} + \frac {1}{3} \, b^{2} d^{2} n^{2} \log \left (x\right )^{3} - \frac {1}{2} \, b^{2} n^{2} x^{2} e^{2} \log \left (x\right ) - 4 \, b^{2} d n^{2} x e \log \left (x\right ) + b^{2} n x^{2} e^{2} \log \left (c\right ) \log \left (x\right ) + 4 \, b^{2} d n x e \log \left (c\right ) \log \left (x\right ) + b^{2} d^{2} n \log \left (c\right ) \log \left (x\right )^{2} + \frac {1}{4} \, b^{2} n^{2} x^{2} e^{2} + 4 \, b^{2} d n^{2} x e - \frac {1}{2} \, b^{2} n x^{2} e^{2} \log \left (c\right ) - 4 \, b^{2} d n x e \log \left (c\right ) + \frac {1}{2} \, b^{2} x^{2} e^{2} \log \left (c\right )^{2} + 2 \, b^{2} d x e \log \left (c\right )^{2} + a b n x^{2} e^{2} \log \left (x\right ) + 4 \, a b d n x e \log \left (x\right ) + b^{2} d^{2} \log \left (c\right )^{2} \log \left (x\right ) + a b d^{2} n \log \left (x\right )^{2} - \frac {1}{2} \, a b n x^{2} e^{2} - 4 \, a b d n x e + a b x^{2} e^{2} \log \left (c\right ) + 4 \, a b d x e \log \left (c\right ) + 2 \, a b d^{2} \log \left (c\right ) \log \left (x\right ) + \frac {1}{2} \, a^{2} x^{2} e^{2} + 2 \, a^{2} d x e + a^{2} d^{2} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2*(a+b*log(c*x^n))^2/x,x, algorithm="giac")

[Out]

1/2*b^2*n^2*x^2*e^2*log(x)^2 + 2*b^2*d*n^2*x*e*log(x)^2 + 1/3*b^2*d^2*n^2*log(x)^3 - 1/2*b^2*n^2*x^2*e^2*log(x
) - 4*b^2*d*n^2*x*e*log(x) + b^2*n*x^2*e^2*log(c)*log(x) + 4*b^2*d*n*x*e*log(c)*log(x) + b^2*d^2*n*log(c)*log(
x)^2 + 1/4*b^2*n^2*x^2*e^2 + 4*b^2*d*n^2*x*e - 1/2*b^2*n*x^2*e^2*log(c) - 4*b^2*d*n*x*e*log(c) + 1/2*b^2*x^2*e
^2*log(c)^2 + 2*b^2*d*x*e*log(c)^2 + a*b*n*x^2*e^2*log(x) + 4*a*b*d*n*x*e*log(x) + b^2*d^2*log(c)^2*log(x) + a
*b*d^2*n*log(x)^2 - 1/2*a*b*n*x^2*e^2 - 4*a*b*d*n*x*e + a*b*x^2*e^2*log(c) + 4*a*b*d*x*e*log(c) + 2*a*b*d^2*lo
g(c)*log(x) + 1/2*a^2*x^2*e^2 + 2*a^2*d*x*e + a^2*d^2*log(x)

________________________________________________________________________________________

Mupad [B]
time = 3.78, size = 152, normalized size = 1.11 \begin {gather*} {\ln \left (c\,x^n\right )}^2\,\left (\frac {b^2\,e^2\,x^2}{2}+2\,b^2\,d\,e\,x+\frac {a\,b\,d^2}{n}\right )+\ln \left (c\,x^n\right )\,\left (\frac {b\,\left (2\,a-b\,n\right )\,e^2\,x^2}{2}+4\,b\,d\,\left (a-b\,n\right )\,e\,x\right )+a^2\,d^2\,\ln \left (x\right )+\frac {e^2\,x^2\,\left (2\,a^2-2\,a\,b\,n+b^2\,n^2\right )}{4}+2\,d\,e\,x\,\left (a^2-2\,a\,b\,n+2\,b^2\,n^2\right )+\frac {b^2\,d^2\,{\ln \left (c\,x^n\right )}^3}{3\,n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + b*log(c*x^n))^2*(d + e*x)^2)/x,x)

[Out]

log(c*x^n)^2*((b^2*e^2*x^2)/2 + 2*b^2*d*e*x + (a*b*d^2)/n) + log(c*x^n)*((b*e^2*x^2*(2*a - b*n))/2 + 4*b*d*e*x
*(a - b*n)) + a^2*d^2*log(x) + (e^2*x^2*(2*a^2 + b^2*n^2 - 2*a*b*n))/4 + 2*d*e*x*(a^2 + 2*b^2*n^2 - 2*a*b*n) +
 (b^2*d^2*log(c*x^n)^3)/(3*n)

________________________________________________________________________________________